<template>
  <view class="page-box page-imgList">
    <image v-for="(item,index) in list" @click="picView(index,list)" :key="index" :src="item.image" mode="aspectFill" class="imgList-item"></image>
  </view>
</template>
<script setup lang="ts">
import {ref} from 'vue'
const props = defineProps({
  list: {
    type: Array,
    default: () => []
  }
})

const picView = async (current:any,list:any) => {
  const array:any = []
  await list.forEach((item:any,index:any) => {
    array.push(item.image)
  })
  uni.previewImage({
    current,
    urls: array
  })
}
</script>
<style scoped lang="scss">
.page-imgList {
  display: grid;
  grid-template-columns: repeat(2,1fr);
  gap: 20rpx;
  .imgList-item {
    width: 100%;
    height: 300rpx;
    border-radius: 20rpx;
  }
}
</style>